import cv2
import numpy as np
import matplotlib.pyplot as plt

# 1. 读取图像并转为灰度图
img = cv2.imread("10/7.png", cv2.IMREAD_GRAYSCALE)

# 2. 高斯模糊去噪（可以换成中值滤波试试效果）
blurred = cv2.medianBlur(img, 7)
# blurred = cv2.medianBlur(blurred, 3)

cv2.imshow('Median', blurred)

cv2.waitKey(0)
cv2.destroyAllWindows()
